﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Aceso.LOreal.Web.Controllers;
using Aceso.LOreal.Vendor;
using Aceso.LOreal.Vendor.Dto;

namespace Aceso.LOreal.Web.Areas.ModuleSys.Controllers
{
    public class DemoController : LOrealControllerBase
    {
        private readonly IVendorAppService _vendorAppService;

        public DemoController(IVendorAppService vendorAppService)
        {
            _vendorAppService = vendorAppService;
        }

        // GET: ModuleSys/Test
        public ActionResult Index()
        {
            //var dataContext = new Aceso.LOreal.EntityFramework.LOrealDbContext();
            //var vendor = from m in dataContext.Vendors
            //             select m;
            //ViewData.Model = dataContext.Vendors.ToList();
            //return View();

            GetVendorInput input = new GetVendorInput() { Name = "" };

            ViewBag.ViewModel = _vendorAppService.GetVendors(input).Vendors;
            return View();
        }
    }
}